package com.shuwen.gcdj.mapper.mysql;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shuwen.gcdj.bean.role.request.GetAllRoleReq;
import com.shuwen.gcdj.bean.role.response.RoleItemResp;
import com.shuwen.gcdj.bean.rolepower.response.PowerLevelResp;
import com.shuwen.gcdj.entity.AccountRole;
import com.shuwen.gcdj.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色(t_user_role)数据Mapper
 *
 * @author without dao
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2021-11-24 21:19:28
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 分页获取所有角色列表
     *
     * @return List<RoleItemResp>
     */
    IPage<RoleItemResp> getAllList(Page<RoleItemResp> page, @Param("bean") GetAllRoleReq bean);

    /**
     * 获取所有角色列表
     *
     * @return List<RoleItemResp>
     */
    List<RoleItemResp> getRoleList();

    /**
     * 通过用户id获取所有角色列表
     *
     * @return List<RoleItemResp>
     */
    List<RoleItemResp> getbyaccountid(@Param("bean") GetAllRoleReq bean,@Param("accountRoles")List<AccountRole> accountRoles);

    RoleItemResp getByroleId(@Param("bean") GetAllRoleReq bean, @Param("id")String id);

    List<PowerLevelResp> getListByparent();

    List<PowerLevelResp> getListPageByparent();
}
